import {Component, HostListener, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
import {fromEvent} from "rxjs";
import {AppService} from "../../../../app.service";
import {BaseComponent} from "../../../../support/base.component";
import {HeaderComponent} from "../header.component";

@Component({
  selector: '.ss-platform-main-workspace-manager',
  templateUrl: './workspacemanager.component.html',
  styleUrls: ['./workspacemanager.component.scss'],
  encapsulation: ViewEncapsulation.None
})
export class WorkspaceManagerComponent extends BaseComponent implements OnInit, OnDestroy {

  private subscription: any;

  constructor(public $app: AppService, private headerComponent: HeaderComponent) {
    super()
    this.subscription = fromEvent(window, "click").subscribe(() => {
      this.headerComponent.isDisplayWorkspaceManager = false;
    });
  }

  ngOnInit(): void {
  }

  updateSpaceTitle(): void {
  }

  @HostListener("click", ["$event"])
  click($event: MouseEvent): void {
    $event.stopPropagation();
  }

  ngOnDestroy(): void {
    this.subscription.unsubscribe();
  }

}
